<?php 
error_reporting(0);
session_start();
include "dbConn.php";


$route = $_POST["methods"];
if ($route == "" || $route == null){
    $route = $_GET["methods"];
}
if ("login" == $route){
	$uname = $_POST["username"];
    $upwd = $_POST["userpwd"];
    $sql = "select count(*) num,aid from admin where aUser=? and aPwd=?";
    $stmt = $link->prepare($sql);
    $stmt->bindParam(1,$uname,PDO::PARAM_STR);
    $stmt->bindParam(2,$upwd,PDO::PARAM_STR);
    $res = $stmt->execute();
    if ($res){
        $row = $stmt->fetch(PDO::FETCH_ASSOC);
        if ($row["num"]>=1){
            echo "nihao";
        }
    }
}
if ("add" == $route){
	
	# code...
}
 ?>